home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
dbase
/
fiasco.lha
/
Fiasco_1.2
/
ARexx
/
age.rexx
next >
Wrap
OS/2 REXX Batch file
|
1995-12-09
|
1KB
|
42 lines
/* age.rexx
* ARexx script for calculating of the age using
* "Day of birth" and current date
* Copyright © 1995 Nils Bandener
* $VER: age.rexx 3.2 (9.12.95)
*/
Options Results
Address FIASCO
F_GetFieldCont "DayOfBirth" /* Insert here the field ID
* of the field, which contains
* the day of birth
*/
Date = Result
Parse Var Date GDay "." GMonth "." GYear /* ARexx makes parsing
* of the string
* very easy
*/
Parse Value Date(European) With ADay "/" AMonth "/" AYear /* The dateformat of
* ARexx is a bit diffrent
*/
if length(GYear) <= 2 then GYear = GYear + 1900 /* Years with two digits are
* supposed to be in
* the 20th century
*/
if length(AYear) <= 2 then AYear = AYear + 1900
DYear = AYear - GYear
if GMonth > AMonth then DYear = DYear - 1
else if GMonth = AMonth & GDay > ADay then DYear = DYear - 1
F_SetFieldCont "Age" DYear /* Insert here the correct field ID, too
*/